﻿using Furion.RemoteRequest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/******************************
 * https://furion.baiqian.ltd/docs/http 参考
 *****************************/

namespace Ocelot.Admin.Api.Core
{
    /// <summary>
    /// Consul Http客户端
    /// </summary>
    public interface IConsulHttp : IHttpDispatchProxy
    {
        /// <summary>
        /// 读取Consul指定配置
        /// </summary>
        /// <param name="settingPath"></param>
        /// <param name="dc"></param>
        /// <returns></returns>
        [Get("#(ConsulConfigs:Address)/v1/kv/{settingPath}?dc={dc}")]
        Task<List<GetConsulKeyValueResponse>> GetConsulKeyValueAsync(string settingPath, string dc);


        [Put("#(ConsulConfigs:Address)/v1/kv/{settingPath}?dc={dc}&flags=0")]
        Task<bool> EditConsulKeyValueAsync(string settingPath, string dc, [Body] string jsonObj);
    }
}
